package com.museum.service.api;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseResponse;
import com.museum.entity.DTO.RedisInfo.UserMessage;
import com.museum.entity.DTO.user.UserAdd;
import com.museum.entity.DTO.user.UserQuery;
import com.museum.entity.DTO.user.userAreaDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

/**
 * @author LB
 * @version 1.0
 * @date 2020/12/21 11:25
 */
public interface UserServiceAPI {
    BaseResponse<JSONObject> getAllUserByPage(long current, long limit, UserQuery userQuery,HttpServletRequest request);

    Integer getStatus(String userName, String userPassword);

    UserMessage userLoginByName(String userName, String userPassword);

    userAreaDTO selectById(HashMap<String,Object> map);
    /**
     * @param
     * @Desciption 根据地域编号 拿取地区的权限
     * @return
     */
    List<Integer> getUserAreaPermission(Integer areaNumber);
    /**
     * @param
     * @Desciption 根据用户的id 拿取用户的权限id
     * @return
     */
    List<Integer> getUserPermission(Integer userID);
    /**
     * @param
     * @Desciption 用户的权限id 和 地区的权限id去重
     * @return
     */
    List<Integer> endPermission(List<Integer> areaPermission, List<Integer> userPermission);

    /**
     * @param
     * @Desciption 添加用户 设置权限
     * @return
     */
    BaseResponse<JSONObject> userAdd(HttpServletRequest request,UserAdd userAdd);

    BaseResponse<JSONObject> deleteUserById(HttpServletRequest request, Integer userId);

    BaseResponse<JSONObject> updateUser(HttpServletRequest request, UserAdd user);
}
